# 登录 用户名 密码
from interface import interface
from select1 import select1


def login(users=None):
    count = 0
    while 1 == 1:
        get_key = input("请输入用户名:")
        get_password = input("请输入密码:")
        back = None
        for i in users:
            if get_key == i["用户名"] and get_password == i["密码"]:
                print("密码正确！")
                back = {"用户名": get_key, "密码": get_password}

        if back == None:
            count += 1
            if count == 3:
                print("你输入三次密码错误！")
                break
            else:
                print("您已经输入错误", count, "次，还有", 3 - count, "次机会！")
                continue
        else:
            count = 0
            interface()  # 调用功能界面
            select1()  # 调用选择功能
            break


